/**
 * 登录模块，提供登录相关业务功能
 * 
 * @Date: 2015-6-16
 * @author: Jackson wang
 * @version: 1.0
 * @since: 1.0
 */
define(["jquery", "datagridServ","bsMsgServ", "init","btnServ","bsButton","formServ","codeDef",'uploadfiles','bsUtil','oaMain',
	"buttonEvent",'moment','bootstrap-datetimepicker','bootstrap-datetimepicker.zh-CN','dateUtil','flowSelect','procurementUtils'],
		function($,datagridServ, bsMsgServ, init, btnServ,bsButton,formServ,codeDef,uploadfiles,bsUtil,oaMain,
			buttonEvent,moment,datetimepicker,datetimepickerLang,dateUtil,flowSelect,procurementUtils) {

			'use strict';

			var _buttonConfig,_moduleConfig,_defaultConfig,
				//锚记datagrid目标元素
				$dg,
				//初始化后的datagrid dom对象
				$grid,
				//编辑弹窗对象及弹窗按钮对象
				$edit_window,window_btn,				
				
				//业务表单对象
				$form,selectedRecord,
				
				//模块基本配置
				_df = {
					pur_typeid	: 3,
					pur_typename: '中型资产',
					moduleCode	: 'procurementDirect'
					
				},
				
				currentConfig = {
					//当前模块名称
					moduleCode:null,
					
					
					//采购计划数据					
					planData:null,
					
					//审批流程数据
					flowData:null,
					
					//工作方案数据
					schemaData:null,
					
					//招标公告数据
					publicData:null,
					
					//议价审批
					priceData:null,
					
					//采购执行数据
					execData:null
				},
				
				saveUrl = '/procurementDirect/save.action',
				
				planEditUrl='/procurementDirect/query/getPage.action?code=bsAssetMiddleDlg',
				
				//获取附件列表url
				uploadListurl = '/upload/query/getInitListDomain.action',
				//页面根节点dom元素
				rootid = 'bs-procurement-asset-middle',	
				
				//表单页面名称
				formName = 'bsAssetMiddleForm',
				execFormName = 'bsAssetMiddleExecForm',
				
				//模块代码
				moduCode ={ 
					//采购计划
					plan:'procurementAssetMiddle',
					
					//采购执行
					planExec:'procurementExec',
					
					//工作方案
					planSchema:'oaProcurementSchema',
					
					//招标公告
					bidPublic:'oaProcurementPublic',
					
					//议价结论:''
					bargain:'oaProcurementBargain',
					
					contract: 'oaContract',
					
					applyBizcode	: 'oaAssetPurchaseMid'
				},
				
				//模块配置
				_moduleConfig,
				
				//调用参数缓存
				mainParam;
											
							
				
			var public_method = {
				
				/**
				 * 在列表页面替换打开
				 */
				replaceInit:function(_options){
					if(_options){
						
						var _c = $('#'+rootid + ' .list-detail');
						if(_c.length==1){
							_c.empty();
							_c.load('/'+init.getSite() +planEditUrl);									
						}
					}
					
					private_method.clearCache();
					
					mainParam = _options;
					currentConfig.planData = _options.row;
					
				}
				,
				init:function(doc){
					private_method.init(doc);
				},
				destroy:function(){
					
					
					window_btn = $('#'+ rootid +' .btn-container button')
					if(window_btn.length>0){
						window_btn.unbind('click')
					}
					
					
					var file_btn = $('#'+rootid +' .archive-btn')
					if(file_btn.length>0){
						file_btn.unbind('click');
						
					}					
					_moduleConfig = null;		
					
					
					
				}
				
				
			}

			var util = {
				getConfig:function(){
					
					if(!_moduleConfig){
						_moduleConfig = init.getBizConfig({bizcode:moduCode.plan})
					}
					return _moduleConfig
				}
			}
			
			var private_method = {				
				
				init : function(_options) {
					if (window.console) {
						console.info('bsProcurementMiddleEdit loaded...');
					}
					
					var _config = util.getConfig() ;				
					
					//绑定导航事件
					private_method.bindNavEvent();
					
					
					
					//定位分类和明细dom对象
					
					$grid = $('#'+rootid + ' .dg-list');
					
					//定位form对象
					$form = $('#'+rootid + ' .main-form')
					
					//清除原有form数据
					$form.form('clear');
					
					selectedRecord = {}
					if(currentConfig.planData ){
						selectedRecord = currentConfig.planData	
					}									
					
					//判断用户名是否为空
					if(!selectedRecord.apply_name){
						var usr = init.getCurrentUser();				
						if(usr){						
							selectedRecord.apply_id = usr.id;						
							selectedRecord.apply_name = usr.name;						
							selectedRecord.apply_deptid = usr.deptid;
							selectedRecord.apply_deptname = usr.deptName;							
						}
					}
					
					//初始化发布时间					
					if( !selectedRecord.apply_date){
						selectedRecord.apply_date = dateUtil.getDateValue({format:'yyyy-MM-dd hh:mi:ss'});
					}
										
					currentConfig.planData = selectedRecord;
					
					if(selectedRecord && selectedRecord.id){
						bsUtil.updateProcurementFlowNotify({plan_id:selectedRecord.id});
					}
					
					private_method.initPlan();
				},
				initPlan:function(){
					
					
					
					//初始化时间控件
					private_method.initDatepicker();
					
					var _c = $('#' + rootid + ' .right-container')
					
					//清除原有页面
					if(_c && _c.length===1){
						_c.empty();
					}
					var planFormUrl='/'+init.getSite()+'/procurementDirect/query/getPage.action?code='+ formName;
					_c.load(planFormUrl,function(){
						var _form = $('#' + rootid + ' .main-form')
						_form.form('load',currentConfig.planData)
						
						var _el = $('#'+rootid + ' .main-form .money-control')    			
			    		if(_el.length>0){
			    			_el.unbind('keyup');
			    			_el.bind('keyup',bsUtil.moneyKeyup)
			    		}
						//初始化编辑页面按钮
						private_method.initEditBtn({bizcode:moduCode.plan});
					});
					
					
				}
				,
				
				/**
				 * 初始化计划编辑按钮功能
				 */
				initEditBtn:function(_options){
					if(window.console){
						console.log(' detail edit button init ...')
					}
					
					if(_options && _options.bizcode){
						
						var _btn = bsButton.getBtn({bizcode:_options.bizcode,btnType:'edit',bizType:2});
						
						var _c = $('#'+rootid + ' .btn-container')
						if(_c.length>0){
							_c.empty();
							if(_btn){								
								_c.append(_btn);
								private_method.bindBtnEvent();
							}
						}	
					}
					
				}
				
				,
				
				initPlanExec:function(e){				
					
					
					var _c = $('#' + rootid + ' .right-container')
					
					//清除原有页面
					if(_c && _c.length===1){
						_c.empty();
					}
					var planFormUrl='/'+init.getSite()+'/procurementDirect/query/getPage.action?code='+ execFormName;
					_c.load(planFormUrl,function(){
						var _form = $('#' + rootid + ' .main-form')
						_form.form('load',currentConfig.planData)
						
						//初始化编辑页面按钮
						private_method.initEditBtn({bizcode:moduCode.planExec});
						
						//初始化附件上传
						if(currentConfig.planData && currentConfig.planData.id){
				    		bsUtil.initUpload({
				    			bizcode 	: moduCode.plan,
				    			rootid  	: rootid,
				    			containerid : 'archive-container',
				    			bizno   	: currentConfig.planData.id,
				    			del			: true
				    		})
						}
					});
					
					
				}
				,
				
				/**
				 * 初始化时间控件
				 */
				initDatepicker:function(){
				
					var _date = $('#'+rootid + ' .date_time');					
					
					var _param ={
						language:  'zh-CN',
						format: "yyyy-mm-dd hh:ii:ss",
						autoclose: true,
						minView: "month",
						maxView: "decade",
						todayBtn: true,
						pickerPosition: "bottom-left"
					}
					
					if(_date.length==1){
						if(window.console){
							console.log( ' _date length: ' + 1)
						}
						_date.datetimepicker(_param);						
						
					}				
				},	
							
				
				//绑定按钮事件
				bindBtnEvent:function(){
					
					
					
					window_btn = $('#'+rootid + ' .btn')
					if(window_btn.length>0){
						window_btn.unbind('click')
						window_btn.bind('click',private_method.function_btn_listenner)
					}					
				},
				
				//绑定导航事件
				bindNavEvent:function(){
					
					
					
					var _nav = $('#'+rootid + ' .nav a')
					if(_nav.length>0){
						_nav.unbind('click')
						_nav.bind('click',private_method.function_nav_listenner)
					}					
				},	
				
				//功能按钮监听函数
				function_btn_listenner:function(e){	
					init.applyBtnEvt({btnEvt:e,btnConfig:btnEvent});									
				}
				,
				
				//功能按钮监听函数
				function_nav_listenner:function(e){				
					
    		
		    		//选中状态 class 调整
		    		$('#' + rootid + ' .nav li').removeClass('active');
		    		$(e.currentTarget).closest('li').addClass('active');
		    		
					if(e && e.currentTarget){
						var _type = $(e.currentTarget).attr('nav-type');
						
						if(_type && navEvent[_type]){
							navEvent[_type](e);
						}
					}
				}
				,
				/**
				 * 获取表单验证规则
				 */
				getFormRule:function(){
					var rules = {
						rules:{
							name: 'required'
							
						}
						,
						messages:{
							name: '计划名称不允许为空'
							
						}
					}
					
					return rules;
				}
				,
				loadFlowInfoBak:function(_options,bizcode){
					
					
					if(_options){
						_options.approval_name = _options.bizname+'(' + _options.bizno + ')';
						
						//处理关联审批流程bizno，避免与本模块业务编号冲突
						delete _options['bizno'];						
						delete _options['id'];
						
						_options.approval_no = _options.flowinstid
						
						//处理关联审批流程bizcode，避免与本模块业务代码冲突
						_options.approval_bizcode = _options.bizcode;
						delete _options['bizcode'];
						delete _options['fullbizcode'];
						
						var _form = $('#' + rootid + ' .main-form');
						if(_form.length==1){
							_form.form('load',_options);
						}
						
						$.extend(currentConfig.planData,_options);
					}						
				}
				,
				//更新表单工作方案字段
				loadFlowInfo:function(_options,bizcode){
					
					var _bizcode = 'approval';
					
					var _code = {}
					
					//定义业务模块代码对应字段
					_code[moduCode.planSchema] = 'schema';
					_code[moduCode.bidPublic] = 'bid';
					_code[moduCode.bargain] = 'bargain';
					_code[moduCode.contract] = 'contract';
					if(bizcode){
						_bizcode = _code[bizcode];
					}
					if(_options){
						
						var _data = {}						
						_data[_bizcode + '_name'] = _options.bizname+'(' + _options.bizno + ')';
						_data[_bizcode + '_no'] = _options.flowinstid;
						_data[_bizcode + '_bizcode'] = _options.bizcode
						
						//申请审批流程，将事项名称代入form
						if(_bizcode=== 'approval'){
							_data.name = _options.name
							_data.apply_id = _options.apply_id
							_data.apply_name = _options.apply_name
							_data.apply_deptid = _options.apply_deptid
							_data.apply_deptname = _options.apply_deptname
						}
						
						var _form = $('#' + rootid + ' .main-form');
						if(_form.length==1){
							_form.form('load',_data);
						}
						
						$.extend(currentConfig.planData,_data);
					}						
				}
				,
				clearCache:function(){
				
					//清理缓存
					currentConfig.planData = null;
					
					currentConfig.execData = null;
					
					currentConfig.priceData = null;
					
					currentConfig.flowData = null;
					
					currentConfig.publicData = null;
					
					mainParam = null;
				}
				
			}
			var btnEvent = {
				// 提交form
				editSave : function(e) {
					
					var _f = $('#'+rootid + ' .main-form')
					if(
						!formServ.validateForm({
							form:_f,
							rules:private_method.getFormRule()
						})
					){
						bsMsgServ.errorSlide('请填写表单内容');
						//释放按钮禁用状态
						$(e.currentTarget).removeClass('disabled');
						return
					}
					
					var formData = formServ.getDataObj({
								form : $('#'+rootid + ' .main-form')
							});
					
					//设置分类编码
					if(mainParam.selectedType){
						formData.typeId = mainParam.selectedType.id;
					}
					
					//流程信息
					if(_moduleConfig.flowid){
						formData.flowid = _moduleConfig.flowid
						formData.fullBizcode = _moduleConfig.fullBizcode
					}					
					
					//检测id是否合法，避免tmpid影响保存
					var idVal = formData.id;
					if(idVal){
						if(idVal.indexOf('TMP')>=0){
							formData.id = null;
						}
					}
					
					//业务编码
					if(!formData.bizcode){
						
						$.extend(formData , _df)
					}
					$.ajax({
						url:'/'+init.getSite() + saveUrl,
						data:$.toJSON(formData),
						contentType:'appliction/json;charset=utf-8',
						type:'post',
						dataType:'json',
						success:function(data){
							if(data){
								
								//刷新grid
								var _grid = $('#'+rootid + ' .dg-list');
								if(_grid && _grid.length==1){
									_grid.datagrid('reload')
								}
								
								//刷新form
								$('#'+rootid + ' .main-form').form('load',data);
								
								//更新缓存记录
								currentConfig.planData = data;
								
							}
							bsMsgServ.msgSlide(codeDef.getConfig({
								type:'operate',
								code:'success'
							}))
							
							$(e.currentTarget).removeClass('disabled');
							
							bsUtil.updateProcurementNotify();
						}
						,
						failure:function(){
							bsMsgServ.msgSlide(codeDef.getConfig({
								type:'operate',
								code:'error'
							}))
							$(e.currentTarget).removeClass('disabled');
						}
					})
									
				},				
				
				//
				editCancelReplace : function(e) {
//					$('#'+edit_window_id).window('close');
//					$('#'+edit_window_id).empty();
					$(e.currentTarget).removeClass('disabled');
					
					
					public_method.destroy();
					if(mainParam && mainParam.callback){
						
						mainParam.callback();
					}
					
					$('#'+rootid + ' .search-form').show();
				}
				,
				
				//采购申请审批流程选择
				popAuditFlow:function(e){
					//弹窗流程选择框
					e.stopPropagation();
					e.preventDefault();
					
					if(window.console){
						console.log('select flow loaded...')
					}
					var params = {
						callback:private_method.loadFlowInfo
					}
					flowSelect.openPage(params);
					
					$(e.currentTarget).removeClass('disabled');
				}				
				,				
				//工作方案审批流程选择
				popSchemaFlow:function(e){
					//弹窗流程选择框
					e.stopPropagation();
					e.preventDefault();
					
					if(window.console){
						console.log('select flow loaded...')
					}
					var params = {
						callback:private_method.loadFlowInfo,
						bizcode:moduCode.planSchema
					}
					flowSelect.openPage(params);
					
					$(e.currentTarget).removeClass('disabled');
				}
				,
				//招标公告审批流程选择
				popBidFlow:function(e){
					//弹窗流程选择框
					e.stopPropagation();
					e.preventDefault();
					
					if(window.console){
						console.log('select flow loaded...')
					}
					var params = {
						callback:private_method.loadFlowInfo,
						bizcode:moduCode.bidPublic
					}
					flowSelect.openPage(params);
					
					$(e.currentTarget).removeClass('disabled');
				},
				
				//议价结论审批流程选择
				popBargainFlow:function(e){
					//弹窗流程选择框
					e.stopPropagation();
					e.preventDefault();
					
					if(window.console){
						console.log('select flow loaded...')
					}
					var params = {
						callback:private_method.loadFlowInfo,
						bizcode:moduCode.bargain
					}
					flowSelect.openPage(params);
					
					$(e.currentTarget).removeClass('disabled');
				}
				
				,
				
				//采购合同审批流程选择
				popContractFlow:function(e){
					//弹窗流程选择框
					e.stopPropagation();
					e.preventDefault();
					
					if(window.console){
						console.log('select flow loaded...')
					}
					var params = {
						callback:private_method.loadFlowInfo,
						bizcode:moduCode.contract
					}
					flowSelect.openPage(params);
					
					$(e.currentTarget).removeClass('disabled');
				}
				
				,
				
				downloadFile:function(e){
					
					var _btn = $(e.currentTarget)
					
					var _id = _btn.attr('aid')
					
					var _url = '/'+init.getSite() +'/upload/downloadFileTest.action'
					var form = $("<form>");
					form.attr('style','display:none');
					form.attr('target','');
					form.attr('method','post');
					form.attr('action',_url);
					var input1 = $("<input>");
					input1.attr('type','hidden')
					input1.attr('name','id')
					input1.attr('value',_id);
					$('body').append(form);
					$(form).append(input1);
					
					form.submit();
					form.remove();
				}
				
				,
				removeFile:function(e){
					var _btn = $(e.currentTarget)
					
					var _id = _btn.attr('aid')
					
					if(_id){
						$.messager.confirm('警告', '确定执行删除操作?', function(r){
						
							if( r){	
								var _url = '/'+init.getSite() +'/upload/del.action';
								$.ajax({
									url:_url,
									data:{id:_id},
									success:function(data){
										if(data && data.status=='success'){
											private_method.initArchive();
											bsMsgServ.msgSlide();
										}else{
											bsMsgServ.warnSlide();
										}
									}
									,
									error:function(){
										bsMsgServ.warnSlide();
									}
								})
							}
						})
					}
					
				}
				,
				previewFile:function(e){
					var _btn = $(e.currentTarget)
					
					var _id = _btn.attr('aid')
					if(_id){
						var _url = '/'+init.getSite() +'/upload/previewFile.action';
						
						$.ajax({
							url:_url,
							data:{id:_id},
							success:function(data){
								var _title = $('#'+rootid + ' .modal-title')
								var _content = $('#'+rootid + ' .modal-body')
								
								if(data){
									
									if(data.archiveContent){
										//附件页面预览
										private_method.initArchiveContent(data)
									}else{
										//普通页面预览
										if(data.fileName){
											_title.text(data.fileName)
										}
										if(data.content){
											_content.append(data.content)	
										}
									}
								}
								var _m = $('#'+rootid + ' #doc-preview');
								_m.modal('show');
							}
							,
							error:function(){
								bsMsgServ.warnSlide();
							}
						})
					}
				}

			};

			var navEvent = {
				//采购计划事件
				navPlan:function(e){
					
					private_method.initPlan();
					
				},
				
				
				//审批流程事件
				navFlow:function(e){
					
					//获取关联审批流程信息
					
					utils.loadForm({
						rootid:rootid,
						flowField:'approval_no',
						bizField:'approval_bizcode',
						flowBizcode:moduCode.applyBizcode}
					);				
					
				},
				
				//工作方案事件
				navSchema:function(){
					
					utils.loadForm({
						rootid:rootid,
						flowField	: 'schema_no',
						bizField	: 'schema_bizcode',
						currentUser	: true,
						flowBizcode	: 'oaProcurementSchema'
					});		
					
				},
				
				//招标公告事件
				navPublic:function(){
					
					utils.loadForm({rootid:rootid,flowField:'bid_no',bizField:'bid_bizcode',
						flowBizcode:'oaProcurementPublic'});	
					
					
				},
				
				//议价结论事件
				navBargain:function(){
					
					utils.loadForm({
						rootid		: rootid,
						flowField	: 'bargain_no',
						bizField	: 'bargain_bizcode',
						flowBizcode	: 'oaProcurementBargain',
						currentUser	: true
					});	
					
				},
				
				//合同事件
				navContract:function(){
					
					utils.loadForm({
						rootid: rootid, 
						flowField: 'contract_no', 
						bizField: 'contract_bizcode',
						flowBizcode: 'oaContract',
						currentUser: true
					});					
					
				},
				//采购执行事件
				navExec:function(){
				
					private_method.initPlanExec();
				}
				,
				//中标通知书
				navBidding:function(){
					procurementUtils.loadArchiveForm({
						data		: currentConfig.planData,
						rootid		: rootid,
						archiveCode	: 'bidding',
						archiveList	: ['1、中标通知书']
					})
				}
				,
				navAcceptance:function(){
					procurementUtils.loadArchiveForm({
						data		: currentConfig.planData,
						rootid		: rootid,
						archiveCode	: 'acceptance',
						archiveList	: ['1、验收报告']
					})
				}
			}
			
			var utils = {
				
				/**
				 * @Param _options.flowField	流程唯一代码字段
				 * @Param _options.bizField		业务代码字段
				 * @Param _options.rootid		dom根节点id
				 * @Param _options.flowBizcode  流程业务代码		
				 * @param _options.currentUser	初始化申请用户标志
				 */
				loadForm:function(_options){
					
					//获取关联审批流程信息
					var _flowid,_flowBiz
					
					var _flowField,_bizField
					
					if(_options){
						_flowField = _options.flowField
						_bizField = _options.bizField
					}
					
					if(currentConfig.planData && _flowField && _bizField){
						var _flowid = currentConfig.planData[_flowField];
						var _flowBiz = currentConfig.planData[_bizField];
						
						
						//判断是否已经发起审核流程
						if(_flowid && _flowBiz){
							var _usr = init.getCurrentUser();
							
							if(_usr && _usr.id){
								var canOperate = procurementUtils.validateFlowUser({flowInstId:_flowid,userid:_usr.id});
								//已经发起审核，获取当前流程节点人员信息
								
								//判断当前人员是否具有流程操作权限
								if(canOperate){
									//当前人员可以操作流程
									//加载业务模块按钮
//									procurementUtils.loadBtn({rootid:_options.rootid,flowBizcode:_options.flowBizcode});
									
									//将流程业务的flowInstId与bizcode传递到oa模块
									oaMain.openEditPage({
					    				rootid	: rootid,
					    				bizcode	: _flowBiz,					    				
					    				flowInstId	: _flowid,					    				
					    				isView		: false,
					    				sendCallback	: function(data){procurementUtils.loadSuccessForm({rootid:rootid})},
			    						backCallback	: function(data){procurementUtils.loadSuccessForm({rootid:rootid})}
					    			})
					    			
					    			//加载form表单
									procurementUtils.loadFlowForm({flowid:_flowid,flowBiz:_flowBiz,rootid:rootid})
								}else{
									
									//加载浏览按钮 
//									procurementUtils.loadViewBtn({rootid:rootid,flowBizcode:_flowBiz});
									//将流程业务的flowInstId与bizcode传递到oa模块
									oaMain.openEditPage({
					    				rootid	: rootid,
					    				bizcode	: _flowBiz,					    				
					    				flowInstId	: _flowid,
					    				isView		: true
					    			})
					    			
					    			//加载form表单
									procurementUtils.loadFlowViewForm({flowid:_flowid,flowBiz:_flowBiz,rootid:rootid})
								}
								
								
								
								
							}
						}else{
							utils.loadAdd({
								flowBiz		: _options.flowBizcode,
								currentUser	: _options.currentUser
							});
							procurementUtils.loadEmptyForm({rootid:_options['rootid']});
							//未发起审批流程，显示提示信息
						}
					}
				}
				,
				/**
				 * @Param _options.flowBiz	流程业务代码
				 * @param _options.initUser 初始化申请用户标志
				 */
				loadAdd:function(_options){
					var _btn = '<button type="button" class="btn btn-warning btn-sm pull-right" btn-type="listAdd">'+
						'<span class="glyphicon glyphicon-plus"></span> 新增'+	           
					'</button>'
					var _c = $('#' + rootid + ' .btn-container')
					if(_c){
						_c.empty();						
						_c.append(_btn);
						var _btn = $('#' + rootid + ' [btn-type="listAdd"]');
			    		_btn.unbind('click');
			    		_btn.bind('click',function(){
			    			var _pageParam = {
			    				rootid	: rootid,
			    				bizcode	: _options.flowBiz,
			    				form	: $('#' + rootid + ' .main-form'),
			    				data	: currentConfig.planData,
			    				saveCallback	: utils.saveCallback,
			    				sendCallback	: function(data){
			    					procurementUtils.loadSuccessForm({rootid:rootid})
			    				},
			    				backCallback	: function(data){
			    					procurementUtils.loadSuccessForm({rootid:rootid})
			    				}
			    			}
			    			if(_options.currentUser){
			    				_pageParam.data = $.extend({},currentConfig.planData,procurementUtils.getCurrentUser())	
			    			}
			    			
			    			oaMain.openAddPage(_pageParam);		    			
			    			    			
			    			
			    			//加载表单
			    			procurementUtils.loadFlowForm({flowBiz:_options.flowBiz,rootid:rootid})
			    		})
					}
				}
				,
				
				saveCallback:function(data){				
					if(data && data.bizcode && data.flowInstId){
						var _data = procurementUtils.getBackFlowInfo({data:data,moduCode:moduCode})					
						
						$.extend(currentConfig.planData,_data);
						//保存计划
						$.ajax({
							url:'/'+init.getSite() + saveUrl,
							data:$.toJSON(currentConfig.planData),
							contentType:'appliction/json;charset=utf-8',
							type:'post',
							dataType:'json',
							success:function(data){
								bsMsgServ.msgSlide(codeDef.getConfig({
									type:'operate',
									code:'success'
								}))
								bsUtil.updateProcurementNotify();
							}
						})
					}
				}
			
			}
			
			
			return public_method;

		});